package com.slkj.shilixiaoyuanapp.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created  on 2018-08-29
 *
 * @author 唐开阔
 * @describe
 */
public class NoticeDetailEntity {
    private String intime;
    private String title;
    private String body;
    private int  state;//1已收藏

    private List<String> images;
    private ArrayList<ReadEntity> read;
    private List<FileEntity> files;
    private ArrayList<ReadEntity> noRead;

    public List<String> getImages() {
        return images;
    }

    public void setImages(List<String> images) {
        this.images = images;
    }

    public ArrayList<ReadEntity> getRead() {
        return read;
    }

    public void setRead(ArrayList<ReadEntity> read) {
        this.read = read;
    }

    public List<FileEntity> getFiles() {
        return files;
    }

    public void setFiles(List<FileEntity> files) {
        this.files = files;
    }

    public ArrayList<ReadEntity> getNoRead() {
        return noRead;
    }

    public void setNoRead(ArrayList<ReadEntity> noRead) {
        this.noRead = noRead;
    }

    public static class ReadEntity implements Parcelable{
        /**
         * id : 4
         * name : 邓平平
         * phone : 13702020222
         * headImg : /images/school3/head/1533869873953.png
         */

        private int id;
        private String name;
        private String className;
        private String head;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getClassName() {
            return className;
        }

        public void setClassName(String className) {
            this.className = className;
        }

        public String getHead() {
            return head;
        }

        public void setHead(String head) {
            this.head = head;
        }

        public static Creator<ReadEntity> getCREATOR() {
            return CREATOR;
        }

        protected ReadEntity(Parcel in) {
            id = in.readInt();
            name = in.readString();
            className = in.readString();
            head = in.readString();
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(id);
            dest.writeString(name);
            dest.writeString(className);
            dest.writeString(head);
        }

        @Override
        public int describeContents() {
            return 0;
        }

        public static final Creator<ReadEntity> CREATOR = new Creator<ReadEntity>() {
            @Override
            public ReadEntity createFromParcel(Parcel in) {
                return new ReadEntity(in);
            }

            @Override
            public ReadEntity[] newArray(int size) {
                return new ReadEntity[size];
            }
        };

        @Override
        public String toString() {
            return "ReadEntity{" +
                    "id=" + id +
                    ", name='" + name + '\'' +
                    ", className='" + className + '\'' +
                    ", head='" + head + '\'' +
                    '}';
        }
    }

    public static class FilesEntity {
        /**
         * path : http://47.106.8.136:8082/files/school3/notice/1535511662042.jpg
         * name : PicturesJPEG_20180328_140037_.jpg
         */

        private String path;
        private String name;

        public String getPath() {
            return path;
        }

        public void setPath(String path) {
            this.path = path;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public String getIntime() {
        return intime;
    }

    public void setIntime(String intime) {
        this.intime = intime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public boolean isCollection(){
        return  state == 1;
    }
}
